﻿<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Activity_Index_Grid.aspx.vb" Inherits="PubProject.Activity_Index_Grid"%>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>a</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<link rel="stylesheet" type="text/css" href="/_nav/taskbox.css">
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_controls/find/find.js"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<script language="javascript" src="/_nav/menu.js"></script>
		<script language="javascript" src="Activity.js"></script>
		<script language="javascript" src="/PubProject/Js/Public.js"></script>
		<script language="javascript">
		
			//新增活动人群
			function OpenTjFilter()
			{
				var sTitle, sHeight, sWidth, sFile;
				
				sTitle = "活动人群定义";
				sHeight = "630";
				sWidth = "840";
				sFile = "/PubProject/Activity/CstFilter.aspx";

				var rdNum = Math.random();

				// 后缀参数
				var sParams = "";
		
		        sParams += "From=" +escape("KHGH") ;      
				sParams += "&BizObject=" + parent.document.all.txtBizObjectRoot.value; 
				sParams += "&open=" + escape(document.all.txtAppName.value); 
				sParams += "&rdnum=" + escape(rdNum);
				sParams += "&ActItemID=" + escape(window.parent.document.all.txtActExecGUID.value);
				sParams += "&mode=" +escape("Add") ;      
				sParams += "&txtType=" +escape(window.parent.document.all.txtActType.value) ;          
				sParams += "&entity=" + parent.document.all.txtBizObjectRoot.value + "&primarykey=" + parent.document.all.txtBizObjectPK.value
                     
				ReturnValue = OpenModalWin(sTitle,sFile,sParams,sWidth,sHeight,window);

				if ( ReturnValue != undefined) 
				{ 
					location.href="Activity_Index_grid.aspx?ReturnValue=" + window.parent.document.all.txtActExecGUID.value + "&open=" + escape(__open.value)+ "&templatetype=" + escape(window.parent.document.all.txtActType.value) + "&txtIsCreate=1" + "&funcid=" + document.all.txtFuncid.value + "&rdn=" + Math.random();

					var arrTrn=ReturnValue;
					//把返回的查询条件填充到父级窗口
					window.parent.document.getElementById("txtFilterStru").value=arrTrn[0];
					window.parent.document.getElementById("divFilter").innerText="\n"+arrTrn[1];
					window.parent.document.getElementById("txtIsImport").value="0";
				}
			}

			/*		
			//短信快速通道
			function OpenAddWin()
			{
				OpenModalWin("短信发送","/PubProject/Activity/ActivityNew_Index.aspx","open=" + escape(__open.value),"900","850");
				appGrid.frameElement.Query();
			}		
			
			//修改
			function OpenModiWin(sOID)
			{
				var sUrl;
				if(!document.all.__open)
					sUrl = "/PubProject/Activity/Activity_ActivityMNG_Grid.aspx?mode=3&ActExecGUID=" + sOID;
				else
					sUrl = "/PubProject/Activity/Activity_ActivityMNG_Grid.aspx?mode=2&ActExecGUID=" + sOID;

				if(!document.all.__open)
				{
					sUrl += "&funcid=00000112";	
				}	
				else
				{
					if(document.all.__open.value=="Hyxt") 
						sUrl += "&funcid=01030303";
					else if (document.all.__open.value=="Slxt")
						sUrl += "&funcid=01010204";	
					else
						sUrl += "&funcid=01040305";	
				}
				OpenWin(sUrl,780,560,0);
			}
			*/
			
			//删除
			function OpenDelWin()
			{   
				// 选中行对象数组
				var arrTr = appGrid.frameElement.getSelected();
				if (!arrTr) 
				{
                    //alert("没有选中发送对象！");
				    return;
				}
				
				// 拼写 oids
				//
				var oids = "";
				for ( var i = 0; i < arrTr.length; i++ )
				{
					if ( i == 0 )
						oids += arrTr[i].oid;
					else
						oids += ";" + arrTr[i].oid;
				}
				if ( oids == "" ) return;		// 如果没有选中记录
				
				var result ;
				if(!document.all.__open)
				{
					result = publicDelete("00000112","33",oids);
				}
				else
				{
					if(__open.value == "Slxt")
						result = publicDelete("01010204","33",oids);
					else if(__open.value == "Hyxt")
						result = publicDelete("01030303","33",oids);
					else
						result = publicDelete("01040305","33",oids);
				}
				
				 
				
				// 处理返回结果
				if ( result == "success" )			// 如果删除成功
				{
					appGrid.frameElement.Query();
				}
				else if ( result == "cancel" )		// 如果取消删除
					return;
				else								// 如果删除失败
					alert( result );
		
			}
			
			function window.onload()
			{
				if(!document.all.__open)
				{
			       document.all.c1.className="noactive";
			       document.all.c1.action="undefined";
				}
//			    if(document.all.__IsOutIn)
//			    {
//			      if(document.all.__IsOutIn.value=="1") deDisplay("c1,m0,m1,m2,m3");			    
//			    }

                //系统设置》交互日志
			    if(document.all.__mode&&document.all.__mode.value=="3")
			    {
			       deDisplay("m0,m1,m2,m3,c1");
//                   document.all.m0.className="noactive";
//			       document.all.m0.action="undefined";
//		           document.all.m1.className="noactive";
//			       document.all.m1.action="undefined";
//			       document.all.m2.className="noactive";
//			       document.all.m2.action="undefined";
//			       document.all.m3.className="noactive";
//			       document.all.m3.action="undefined";
//			       document.all.c1.className="noactive";
//			       document.all.c1.action="undefined";
			    }
			    
			    if(document.all.__txtIsCreate.value!=1)
			    {
			       //deActive("c1");
			       document.all.c1.className="noactive";
			       document.all.c1.action="undefined";
			    }

			    try
			    {   if(__templatetype&&__templatetype.value!="短信")
			        {
						var strinnerHTML=appGrid.frames(0).frameElement.document.all.trHeader.cells[4].innerHTML.replace(/手机号码/g,"Email");;
						appGrid.frames(0).frameElement.document.all.trHeader.cells[4].innerHTML=strinnerHTML;	
						appGrid.frames(0).frameElement.document.all.trHeader.cells[4].title="按Email排序";
					}
			    }
			    catch(e)
			    {
			    }			    	   
			}
			
		
			//导出收件人模版
			function OutputActivityTmp()
			{
		        document.all("txtBldGUIDList").value = "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF";   //FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF为没用数据，为空后面会中断
			    document.all("txtProjGUID").value = "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF";      //FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF为没用数据，为空后面会中断
			    document.all("txtModuleType").value = "导出收件人模版";
			    window.open("/slxt/XMZB/FileDown.aspx","","top=20000,left=20000,width=10,height=10,status=0,resizable=0");					
			}
			
			//导入收件人模版
			function InputActivityTmp()
			{
				var sFile = "/PubProject/Activity/ImportActivityTmp.aspx";
				var sParams = "ActType=" + escape(parent.Form1.txtActType.value) + "&ActExecGUID=" + escape(parent.Form1.txtActExecGUID.value);
				var strReturn = OpenModalWin("收件人导入", sFile, sParams, 680, 480);
				if (strReturn != undefined)
				{
					//刷新列表
					window.parent.document.getElementById("txtIsImport").value="1";
					appGrid.frameElement.Query();
				}
			}
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form class="map" id="Form1" runat="server">
			<asp:textbox id="txtActItemID" style="DISPLAY: none" runat="server"></asp:textbox>
			<asp:textbox id="txtAppName" style="DISPLAY: none" runat="server"></asp:textbox>
			<asp:textbox id="txtBizObject" style="DISPLAY: none" runat="server"></asp:textbox>
			<asp:textbox id="txtBizObjectPK" style="DISPLAY: none" runat="server"></asp:textbox>
			<asp:textbox id="txtReturnValue" style="DISPLAY: none" runat="server"></asp:textbox>
			<asp:textbox id="txtIsCreate" style="DISPLAY: none" runat="server"></asp:textbox>
			<asp:textbox id="txtFuncid" style="DISPLAY: none" runat="server"></asp:textbox>
			<input id="txtBldGUIDList" style="DISPLAY: none" type="hidden" name="txtBldGUIDList">
			<input id="txtProjGUID" style="DISPLAY: none" type="hidden" name="txtProjGUID">
			<input id="txtModuleType" style="DISPLAY: none" type="hidden" name="txtModuleType">
		</form>
		<table style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
			<tr height="1">
				<td>
					<mnu:AppGridMenu id="appGridMenu" runat="server" />
				</td>
			</tr>
			<tr>
				<td>
					<cnt:AppGrid id="appGrid" runat="server" MultiSelect="True" filter="<filter/>" />
				</td>
			</tr>
		</table>
	</body>
</HTML>
